﻿using Grow.Domain.Service.CreateDomainService;
using Grow.Module.Service;
using Microsoft.Extensions.DependencyInjection;

namespace Grow.Domain.Service.Core.CreateDomainService
{
    public class CreateDomainServiceBuilder : ICreateDomainServiceBuilder
    {
        private readonly IServiceContainer _serviceContainer;

        public CreateDomainServiceBuilder(IServiceContainer serviceContainer)
        {
            _serviceContainer = serviceContainer;
        }
        public ICreateDomainServiceBuilder AddDomainService<TDomainService, TDomainServiceImplementation>()
           where TDomainService : class, IDomainService
           where TDomainServiceImplementation : class, TDomainService
        {
            _ = _serviceContainer.ServiceCollection.AddTransient<TDomainService, TDomainServiceImplementation>();
            return this;
        }

    }
}
